-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync-with-eclipse-ecal-2024-08-02 #77
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
}; | ||
} | ||
|
||
namespace Startup | ||
{ | ||
struct Configuration | ||
{ | ||
std::string terminal_emulator; //!< | ||
std::string terminal_emulator { "" }; //!< Linux only command for starting applications with an external terminal emulator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant string initialization [readability-redundant-string-init]
std::string terminal_emulator { "" }; //!< Linux only command for starting applications with an external terminal emulator | |
std::string terminal_emulator; //!< Linux only command for starting applications with an external terminal emulator |
namespace | ||
{ | ||
// After switchting to c++17, this can be replaced by an inline constexpr | ||
static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'log_level_default' defined in a header file; variable definitions in header files can lead to ODR violations [misc-definitions-in-headers]
static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal;
^
namespace | ||
{ | ||
// After switchting to c++17, this can be replaced by an inline constexpr | ||
static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'log_level_default' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]
static const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; | |
const eCAL_Logging_Filter log_level_default = log_level_info | log_level_warning | log_level_error | log_level_fatal; |
struct Configuration | ||
{ | ||
bool enable { false }; //!< Enable file logging (Default: false) | ||
std::string path { "" }; //!< Path to log file (Default: "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant string initialization [readability-redundant-string-init]
std::string path { "" }; //!< Path to log file (Default: "") | |
std::string path; //!< Path to log file (Default: "") |
std::string filter_incl{}; //!< Topics whitelist as regular expression (will be monitored only) (Default: "") | ||
eCAL::Types::ConstrainedInteger<1000, 1000> timeout { 5000U }; //!< Timeout for topic monitoring in ms (Default: 5000) | ||
std::string filter_excl { "^__.*$" }; //!< Topics blacklist as regular expression (will not be monitored) (Default: "^__.*$") | ||
std::string filter_incl { "" }; //!< Topics whitelist as regular expression (will be monitored only) (Default: "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: redundant string initialization [readability-redundant-string-init]
std::string filter_incl { "" }; //!< Topics whitelist as regular expression (will be monitored only) (Default: "") | |
std::string filter_incl; //!< Topics whitelist as regular expression (will be monitored only) (Default: "") |
bool IpAddressV4::operator==(const eCAL::Types::IpAddressV4& rhs) const { return m_ip_address == rhs.Get(); }; | ||
bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); }; | ||
bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; | ||
bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'lhs' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; }; | |
bool operator==(const eCAL::Types::IpAddressV4& lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; }; |
ecal/core/include/ecal/types/ecal_custom_data_types.h:58:
- ECAL_API friend bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_);
+ ECAL_API friend bool operator==(const eCAL::Types::IpAddressV4& lhs, const std::string& ip_string_);
bool operator==(eCAL::Types::IpAddressV4 lhs, const char* ip_string_) { return lhs.Get() == std::string(ip_string_); }; | ||
bool operator==(const char* ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; | ||
bool operator==(eCAL::Types::IpAddressV4 lhs, const std::string& ip_string_) { return lhs.Get() == ip_string_; }; | ||
bool operator==(const std::string& ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'rhs' is passed by value and only copied once; consider moving it to avoid unnecessary copies [performance-unnecessary-value-param]
bool operator==(const std::string& ip_string_, eCAL::Types::IpAddressV4 rhs) { return rhs == ip_string_; }; | |
bool operator==(const std::string& ip_string_, eCAL::Types::IpAddressV4 rhs) { return std::move(rhs) == ip_string_; }; |
|
||
// test copy method for config structure | ||
eCAL::Configuration config1(0, nullptr); | ||
eCAL::Configuration config2(0, nullptr); | ||
std::string testValue = std::string("234.0.3.2"); | ||
config2.transport_layer.mc_options.group = testValue; | ||
std::string testValue = "234.0.3.2"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'testValue' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]
std::string testValue = "234.0.3.2"; | |
std::string const testValue = "234.0.3.2"; |
|
||
std::vector<std::string> arguments{}; | ||
|
||
arguments.push_back("test_config_cmd_parser_test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use emplace_back instead of push_back [modernize-use-emplace]
arguments.push_back("test_config_cmd_parser_test"); | |
arguments.emplace_back("test_config_cmd_parser_test"); |
// set a file name as ini file | ||
arguments.push_back("--ecal-config-file " + some_file_name); | ||
// set the dump config flag | ||
arguments.push_back("--ecal-dump-config"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use emplace_back instead of push_back [modernize-use-emplace]
arguments.push_back("--ecal-dump-config"); | |
arguments.emplace_back("--ecal-dump-config"); |
sync-with-eclipse-ecal-2024-08-02